import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'wip_machine_maintain' })
export default class WipMachineMaintain extends BaseEntity {
  @Column({
    type: 'varchar',
    length: 50,
    name: 'machine_maintain_code',
    unique: true,
    comment: '设备保养编号',
  })
  @ApiProperty()
  machineMaintainCode: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'machine_maintain_name',
    comment: '设备保养名称',
  })
  @ApiProperty()
  machineMaintainName: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'machine_code',
    comment: '设备编号',
  })
  @ApiProperty()
  machineCode: string;

  @Column({ type: 'varchar', length: 50, name: 'machine_name', comment: '设备名称' })
  @ApiProperty()
  machineName: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'machine_model',
    comment: '设备型号',
    nullable: true,
  })
  @ApiProperty()
  machineModel: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'period_code',
    comment: '保养类型编码',
  })
  @ApiProperty()
  periodRateCode: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'period_name',
    comment: '保养类型名称',
  })
  @ApiProperty()
  periodRateName: string;

  @Column({
    type: 'datetime',
    nullable: true,
    name: 'plan_maintenance_date',
    comment: '计划保养日期',
  })
  @ApiProperty()
  planMaintenanceDate: Date;

  @Column({
    type: 'varchar',
    nullable: true,
    name: 'maintenance_user',
    comment: '保养人',
  })
  @ApiProperty()
  maintenanceUser: string;

  @Column({
    type: 'varchar',
    nullable: true,
    name: 'maintenance_status',
    comment: '保养状态',
  })
  @ApiProperty()
  maintenanceStatus: string;

  @Column({
    type: 'datetime',
    nullable: true,
    name: 'maintenance_date',
    comment: '实际保养日期',
  })
  @ApiProperty()
  maintenanceDate: Date;

  @Column({
    type: 'varchar',
    nullable: true,
    name: 'is_maintenance',
    comment: '是否已保养',
  })
  @ApiProperty()
  isMaintenance: string;

  @Column({
    type: 'varchar',
    nullable: true,
    name: 'is_auto_add',
    comment: '是否已保养',
  })
  @ApiProperty()
  isAutoAdd: string;

  @Column({ type: 'varchar', nullable: true, comment: '备注' })
  @ApiProperty()
  remark: string;
}
